import 'package:flutter/cupertino.dart';

class HexColor extends Color {
  HexColor(String hexColor) : super(_getColorFromHex(hexColor));

  static int _getColorFromHex(String hexColor) {
    hexColor = hexColor.toUpperCase().replaceAll('#', '');
    if (hexColor.length == 6) {
      hexColor = 'FF$hexColor';
    }
    return int.parse(hexColor, radix: 16);
  }
}

class BnyColor {
  static const Color bgBlackColor = Color.fromRGBO(28, 28, 28, 1.0); //背景色
  static Color gray238BgColor = const Color.fromRGBO(238, 238, 238, 0.05);
  static Color gray238IconColor = const Color.fromRGBO(238, 238, 238, 0.25);
  static Color gray238LightIconColor = const Color.fromRGBO(238, 238, 238, 0.3);
  static Color lightWhiteColor = const Color.fromRGBO(238, 238, 238, 1.0);
  static Color lightAlphaWhiteColor = const Color.fromRGBO(238, 238, 238, 0.1);
  static Color light222WhiteColor = const Color.fromRGBO(222, 222, 222, 1.0);
  static Color light100WhiteColor = const Color.fromRGBO(100, 100, 100, 1.0);
  static Color lightAlpha222WhiteColor = const Color.fromRGBO(222, 222, 222, 0.7);
  static Color lightAlpha255WhiteColor = const Color.fromRGBO(255, 255, 255, 0.1);
  static Color bg51BlackColor = const Color.fromRGBO(51, 51, 51,1.0);
}
